var api = require('../../util/api.js');
Page({
  data: {

  },
  onLoad: function () {
    this.setData({
      jdhpDetail: api.hasPerm('zjjd:wx:13:03:01'),
      sgdwpfDetail: api.hasPerm('zjjd:wx:13:03:02')
    });
    let chain = api.chain();
    api.get(api.url.zjjd.totalList, {
      examineId: chain.examineId,
      userId: chain.userId
    }).then(res => {
      this.setData({
        item: res.rows[0]
      })
    })
  },
  goPlayerList: function (e) {
    let _this = this;
    let chain = api.chain();
    var type = e.currentTarget.dataset.khtype;
    if(type=='jdhp' && !_this.data.jdhpDetail){
      return;
    }
    if(type=='sgdwpf' && !_this.data.sgdwpfDetail){
      return;
    }
    var userId = chain.userId;
    var examineId = chain.examineId;
    let judgeId = api.getSysUser().userId;
    wx.navigateTo({
      url: `../${type}/list?examineId=${examineId}&userId=${userId}`
    })
  }
})